package com.example.yls.demoa;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public class MainActivity extends AppCompatActivity {
  private WuziqiPanel wuziqiPanel;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
      /*  findViewById(R.id.btn_null).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String str=null;
                char a=str.charAt(0);
                    Log.e("MainActivity",String.valueOf(a));
            }
        });

        findViewById(R.id.btn_overIndex).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String str="hello";
                char a=str.charAt(10);
                Log.e("MainActivity",String.valueOf(a));
            }
        });*/
        wuziqiPanel=findViewById(R.id.wuziqi);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_main,menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
       int id=item.getItemId();

       if(id==R.id.action_settings){
           wuziqiPanel.start();
           return true;
       }
        return super.onOptionsItemSelected(item);
    }
}
